package com.tongtech.space.module.common.enums;

/**
 * 用户状态Enum
 * @author jiayu
 * @since 2020/12/14
 */
public enum UserStatusEnum {
    NORMAL((byte)0, "正常"),
    FORBIDDEN((byte)1, "禁用"),
    ;

    private Byte code;

    private String des;

    UserStatusEnum(Byte code, String des) {
        this.code = code;
        this.des = des;
    }
    public static UserStatusEnum get(byte code) {
        for (UserStatusEnum type : UserStatusEnum.values()) {
            if (code == type.getCode()) {
                return type;
            }
        }
        return null;
    }

    public Byte getCode() {
        return code;
    }

    public void setCode(Byte code) {
        this.code = code;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

}
